<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include.inc.jsp"%>
<head>
<script type="text/javascript">
$(function()
		{
			$("#dictdtl").find("a").click(function()
					{
						
							var url="${ctx}/dictdtl/";
							var dictId=$("#dictIdSelect").val();
							if(this.className=='add')
							{
								if(dictId!='')
								{
									url=url+"preCreate/"+dictId+"";
									$.pdialog.open(url, "oo", "新增词典详细",'options:{width:100px,height:100px,max:true,mask:true,mixable:true,minable:true,resizable:true,drawable:true,fresh:true,close:”function”, param:”{msg:’message’}”}');
								}
								else
									alertMsg.error("请选择词典类型");
							}
								
	
						
					});
		
		$("select").change(function()
				{
					var dictId=this.value;
					navTab.reload("dictdtl/list?dictId="+dictId,'');
				});
		});
</script>
</head>
<div id="dictdtl">
<form id="pagerForm" method="post" action="${ctx}/dictdtl/list?dictId=${dictId}">
	<input type="hidden" name="pageNum" value="${page.pageNum}" />
	<input type="hidden" name="numPerPage" value="${page.numPerPage}" /> 
	<input type="hidden" name="orderField" value="${page.orderField}" />
	<input type="hidden" name="orderDirection" value="${page.orderDirection}" />
	<input type="hidden" name="keywords" value="${keywords}"/>
</form>

<form method="post" action="${ctx}/dictdtl/list?dictId=${dictId}">
	
	<div class="pageHeader">
		<div class="searchBar">
		<div class="panelBar">
		<span>选择词典类型：</span>
			<select style="width: 180px;" name="dictId" id="dictIdSelect">
			<option value="" >---选择词典类型---</option>
			<c:forEach var="dict" items="${dicts}">
			<c:choose>
			<c:when test="${dict.id==dictId}">
			<option value="${dict.id}" selected="selected"><a target="ajaxToDo" rel="dictdtl" href=""></a>${dict.strName}</option>
			</c:when>
			<c:otherwise>
			<option value="${dict.id}">${dict.strName}</option>
			</c:otherwise>
			</c:choose>
			</c:forEach>
			</select>
		</div>
			<div class="subBar" d>
				<ul>						
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
				</ul>
			</div>
		</div>
	</div>
</form>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		<!-- 此处权限管理混乱，ReceiveAccount:save和Dept:save具有同等效力，后期需要优化。按照数据库配置此处使用ReceiveAccount:save会更好。   2012/12/21 江滨 -->
			<shiro:hasPermission name="Department:save">
				<li><a class="add"><span>添加</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="Department:edit">
				<li><a class="edit" target="dialog" mask="true" width="530" height="300" href="${ctx}/dictdtl/preUpdate/{slt_uid}" ><span>编辑</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="Department:delete">
				<li><a class="delete" target="ajaxTodo" href="${ctx}/dictdtl/delete/{slt_uid}" title="确认要删除该词典?"><span>删除</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<div>
	<table class="table" layoutH="138" width="100%">
		<thead>
			<tr>
				<th>编码</th>
				<th>名称</th>
				<th>类型</th>
				<th>描述</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${dictdtls}" var="dictdtl">
				<tr target="slt_uid" rel="${dictdtl.id}">
					<td>${dictdtl.strSn}</td>
					<td>${dictdtl.strValue}</td>
					<td>${dictdtl.dict.strName}</td>
					<td>${dictdtl.strDesc}</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<!-- 分页 -->
	<c:import url="/WEB-INF/views/pager/panelBar.jsp"></c:import>
</div>
</div>

</div>
